package main

import (
	"go_server/login_server/initializer/config_init"
	"go_server/login_server/initializer/mysql_init"
	"go_server/login_server/initializer/redis_init"
	"go_server/login_server/initializer/server_init"
	"go_server/login_server/redis_pubsub"
	"go_server/zinx/zlog"
)



func main() {
	configViper := config_init.GetConfigViper()
	serverAddr := configViper.GetString("addr")

	mysql_init.Init()

	redis_init.Init()


	redis_pubsub.StartPublish()
	server_init.Start(serverAddr)


	//==================这里处理服务器关闭事件==========================
	server_init.Stop()
	redis_pubsub.PublishStop()
	zlog.CleanZinxLog(zlog.StdZinxLog)
	redis_init.CloseRedisClient()
}
